import 'package:flutter/material.dart';

void main() {
  runApp(const MaterialApp(
    title: 'Flutter第二天',
    home: FrameLayoutDemo(),
  ));
}

class FrameLayoutDemo extends StatelessWidget {
  const FrameLayoutDemo({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('层叠布局'),
      ),
      body: Center(
        child: Stack(
          children: [
            Image.network(
                'http://pic.baike.soso.com/p/20130828/20130828161137-1346445960.jpg'),
            const Positioned(
              child: Text('这是一个层叠布局中的文字'),
              left: 35.0,
              right: 35.0,
              top: 45.0,
            )
          ],
        ),
      ),
    );
  }
}
